from django.db import models

# Create your models here.
class Station(models.Model):
    """
    站点信息表
    """
    users = models.ForeignKey('users.Users', related_name='station', on_delete=models.CASCADE)
    station_name = models.CharField(max_length=50, verbose_name='站点名', null=False)
    procurator = models.CharField(max_length=20, verbose_name='代理人', null=False)
    id_card = models.CharField(max_length=18, verbose_name='证件号', null=False)
    permit_img = models.ImageField(upload_to='upload_images/permit_pictures', verbose_name='营业执照')
    store_img = models.ImageField(upload_to='upload_images/store_pictures', verbose_name='门店图片')
    phone = models.CharField(max_length=11, verbose_name='手机号码', null=False)
    address = models.CharField(max_length=64, verbose_name='站点地址', null=False)
    longitude = models.DecimalField(max_digits=10, decimal_places=7, verbose_name='经度', null=True)
    latitude = models.DecimalField(max_digits=10, decimal_places=7, verbose_name='纬度', null=True)
    add_time = models.DateTimeField(verbose_name="添加时间", auto_now=True)

    def __str__(self):
        return self.station_name

